<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAttachment extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('attachment', function (Blueprint $table) {
            $table->increments('id');
            $table->string('url')->comment('本地地址');
            $table->string('remoteUrl')->comment('远程地址');
            $table->string('fileType')->comment('文件类型 image file video voice');
            $table->string('fileName')->comment('文件名');
            $table->string('fileSize')->comment('文件大小');
            $table->string('width')->nullable()->comment('宽度');
            $table->string('height')->nullable()->comment('高度');
            $table->string('long')->nullable()->comment('时长');
            $table->tinyInteger('isRemote')->default(0)->comment('是否远程附件 0=否 1=是');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('attachment');
    }
}
